<!-- 收藏的案例-->
<link rel="stylesheet" href="/css/afterLoginPage.css">
<div class="main layui-clear">
	<div class="fly-main layui-clear">
		<div class="wrap clearfix">
			<div class="layui-bar">
		    	<div class="layui-breadcrumbs">
		    		<a class="home" href="/"></a>
					<i class="layui-icon">&#xe602;</i>
			  		<a href="/user/collection.html">收藏</a>
			  		<i class="layui-icon">&#xe602;</i>
			  		<a href="/user/collection/microcase.html">收藏的案例</a>
			  	</div>
		    </div>
		    <#include "/apps/user/userTopInformation.html">
			<div class="home-left ukefu-profile-menu">
				<#include "/apps/user/userinfo.html">
			</div>
			<div class="home-right ukefu-profile" id="commenttopic">
				<div class="content" style="padding-top: 10px;">
					<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
					  <#include "/apps/user/collectionmenu.html">
					  <div class="layui-tab-content" style="height: 100px;">
					    <div class="layui-tab-item layui-show">
						     <table class="user-table pc">
						    	<thead>
							    	<tr>
								    	<th width="40%">已收藏案例</th>
								    	<th width="15%">作者</th>
								    	<th width="15%">回复/查看</th>
								    	<th width="20%">最后发帖</th>
							    	</tr>
						    	</thead>
						    	<tbody>
							    	<#if microList?? && microList.content??>
							    	<#list microList.content as microcase>
							    	<tr onclick="window.location.href = '/admin/microcase/hotDetail/${microcase.id!''}.html?id=${microcase.id!''}'">
								    	<td title="${microcase.title!}">${microcase.title!}</td>
								    	<td >${microcase.author!} </td>
								    	<td>${microcase.answers!0} / ${microcase.views!0}</td>
								    	<td title="${microcase.createtime?string('yyyy-MM-dd HH:mm:ss')}">${microcase.createtime?string('yyyy-MM-dd HH:mm:ss')} </td>
							    	</tr>
									</#list>
									<#else>
									<tr>
								    	<td colspan="4"><i style="font-size:14px;">没有收藏任何帖子</i></td>
							    	</tr>
									</#if>
						    	</tbody>
						    </table>
						    <div class="phone-ul">
						    	<ul>
						    		<#if microList?? && microList.content??>
							    	<#list microList.content as microcase>
							    	<li>
							    		<div class="topic-user-info">
							    			<div class="user-img-box">
							    				<img class="layui-circle" alt="" src="/${microcase.users.fileurl!''}" onerror="this.src='/images/user/default.jpg';this.onerror=null">
							    			</div>
							    			<div class="topic-info-name layui-elip">
							    				<p class="name">${microcase.author!''}</p>
							    				<p class="time">${microcase.createtime?string('yyyy-MM-dd HH:mm:ss')}</p>
							    			</div>
							    			<div class="delete-box layui-clear">
							    				<span class="delete" onclick="collect('${microcase.id!''}','取消')">取消收藏</span>
							    			</div>
							    		</div>
							    		<span class="phone-li-title layui-elip"><a title="${microcase.title!}" href="/admin/microcase/hotDetail/${microcase.id!''}.html?id=${microcase.id!''}'">${microcase.title!}</a></span>
								    	<div class="phone-li-bottm">
								    		<span>${microcase.gradename!''} | <span class="price">￥${microcase.price!?string('0.00')}</span></span>
								    		<div>
								    			<span>评论  ${microcase.answers!0} &nbsp;&nbsp;&nbsp;&nbsp;</span>
								    			<span>浏览  ${microcase.views!0}&nbsp;&nbsp;&nbsp;&nbsp;</span>
								    			<span>下载量  ${microcase.downnums!0}</span>
								    		</div>
								    	</div>
							    	</li>
									</#list>
									</#if>
						    	</ul>
						    </div>
						</div>
					  </div>
					</div> 
				</div>
				<div style="text-align: center" class="front-desk">
			        <div class="laypage-main" id="topicpages"></div>
			    </div>
			</div>
			
		</div>
	</div>
<script>
	layui.use(['element','laypage'], function(){
		  var element = layui.element();
		  
		  var laypage = layui.laypage;
		  laypage({
			    cont: 'topicpages'
			    ,first:'首页'
			    ,last:'末页'
			    ,pages: ${microList.totalPages}
			    ,curr:${microList.number+1}
			    ,skin: '#32c24d'
			    ,jump:function(obj, first){
			    	var curr = obj.curr;
			    	if(!first){
			    		location.href = '/user/collection/microcase.html?p='+curr+"<#if RequestParameters['q']?? && RequestParameters['q'] != ''>&q=${RequestParameters['q']}</#if>";
			    	}
			    }
		});
	});
	//取消收藏
	function collect(id,status){
		$.ajax({
			type: "POST",
			url: "/admin/microcase/collection/" + id,
			dataType: "text",
			data: {
				status: status
			},
			async: true,
			success: function(data) {
				if(data == "收藏"){
					window.location.reload();
				}else{
					window.location.href = "/login.html";
				}
			}
		})
	}
</script>